<template>
  <div class="dashboard-editor-container">
    <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
      <line-chart :chart-data="trendLineChartData" />
    </el-row>
  </div>
</template>

<script>
import LineChart from './components/LineChart'

import trend from '@/trend.json'

const trendLineChartData = {
  fundCode: '000300',
  dateData: trend.indexDatas.map(v => v.date),
  indexData: trend.indexDatas.map(v => v.closePoint),
  profitData: trend.profits.map(v => v.value)
}

export default {
  name: 'DashboardAdmin',
  components: {
    LineChart
  },
  data() {
    return {
      trendLineChartData: trendLineChartData
    }
  },
  methods: {
    handleSetLineChartData() {
      this.trendLineChartData = trendLineChartData
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  //background-color: rgb(240, 242, 245);
  position: relative;

  .github-corner {
    position: absolute;
    top: 0px;
    border: 0;
    right: 0;
  }

  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
}

@media (max-width:1024px) {
  .chart-wrapper {
    padding: 8px;
  }
}
</style>
